/*
    主题发布订阅测试：主题发布客户端
*/

#include "../../client/rpc_client.hpp"

int main()
{
    SetDefaultLogLevel(Level::INFO);
    
    // 1、定义主题客户端
    ns_jsonrpc::ns_client::TopicClient::TopicClientPtr clt = std::make_shared<ns_jsonrpc::ns_client::TopicClient>("127.0.0.1", 8080);

    // 2、主题创建
    clt->topicCreate("music");
    clt->topicCreate("movie");

    // 3、消息发布
    for(int i = 0; i < 10; i++)
    {
        if(i % 2 == 0)
            clt->topicPublic("music", "music_" + std::to_string(i));
        else
            clt->topicPublic("movie", "movie_" + std::to_string(i));
    }
    return 0;
}